package org.keshe;

import org.keshe.data.StuData;
import org.keshe.user.AdminUser;
import org.keshe.user.NormalUser;
import org.keshe.user.User;

import java.sql.SQLException;
import java.time.LocalDate;

public class DebugTest {
    public static void main(String[] args) throws SQLException {
//        AdminUser.getConnection();
//        AdminUser adminUser = AdminUser.logOn("admin", "abc123");
//        if(adminUser != null){
//            System.out.println(adminUser.searchSpareBedForStu(adminUser.getStuDataById("2002")));
//        }
////        adminUser.updateStuData(new StuData("2001", "小明", "M", "计算机系"));
////        adminUser.deleteStuDataById("2003");
//        AdminUser.closeConnection();
//        LocalDate localDate = LocalDate.now();
//        localDate = localDate.minusDays(1);
//        System.out.println(localDate);
        User.getConnection();
        NormalUser normalUser = NormalUser.logOn("10001", "abc123");
        System.out.println(normalUser.getNotReturnStu(LocalDate.now()));
        System.out.println(normalUser.getNoInOutStu(LocalDate.now()));
        User.closeConnection();
    }
}
